package com.woniuxy.woniuticket.movieinfomodule.service.impl;

import com.woniuxy.woniuticket.movieinfomodule.dao.ManagementPackageDAO;
import com.woniuxy.woniuticket.movieinfomodule.service.ManagementPackageService;
import com.woniuxy.woniuticket.pojo.ManagementPackage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created by 赵晓东 on 2019/6/18/018.
 */
@Service
public class ManagementPackageServiceImpl implements ManagementPackageService {

    @Resource
    private ManagementPackageDAO managementPackageDAO;
    @Override
    public ManagementPackage findById(Integer id) {
        return managementPackageDAO.selectByPrimaryKey(id);
    }

    @Override
    public int updatePackage(ManagementPackage managementPackage) {
        Integer id =  managementPackageDAO.selectAll().get(0).getId();
        managementPackage.setId(id);
        System.out.println(managementPackage);
        return managementPackageDAO.updateByPrimaryKey(managementPackage);
    }
}
